package com.yc.card.utils;

import com.yc.nfc.CardInfo;

/**
 * Created by Administrator on 2016-06-30.
 */
public class Nfc {
    static{
        System.loadLibrary("nfc_jniM30");

    }

    public final static native void  getAnthCode(byte[] Snr,byte[]  InKey,byte[]  OutPassword);
    public final static native int  convertBufferToClass(byte[][] Sector,CardInfo CardClass);
    public final static native int  convertClassToBuffer(byte[][] Sector,CardInfo CardClass);

    public final static native int writeBlock(byte flag,byte Addr,byte[] Data,byte[] SendPackge,byte[] RecvPackge);

    public final static native int selectCard(byte flag,byte RequestMode, byte[] Snr,byte[] CardType,byte[] SendPackge,byte[] RecvPackge);

    public final static native int authentication(byte flag,byte[] Snr,byte Sector,byte AuthType,byte[] keys,byte[] SendPackge,byte[] RecvPackge);

    public final static native int readBlock(byte flag,byte Addr,byte[] Data,byte[] SendPackge,byte[] RecvPackge);

    public final static native Licence getLicence(String path);

    public final static native int loadKey(byte flag,byte mode, byte secNr, byte[] nkey,byte[] SendPackge,byte[] RecvPackge);
    public final static native int anticoll(byte flag, byte[] Snr,byte[] SendPackge,byte[] RecvPackge);
    public final static native int request(byte flag,byte RequestMode,byte[] CardType,byte[] SendPackge,byte[] RecvPackge);

    public final static native int Beep(byte flag,char ms,byte[] SendPackge,byte[] RecvPackge);
    public final static native int Halt(byte flag,byte[] SendPackge,byte[] RecvPackge);
    public final static native int open(byte flag,byte[] SendPackge,byte[] RecvPackge);
    public final static native int close(byte flag,byte[] SendPackge,byte[] RecvPackge);
}
